Developer Documentation
PATH  WebObjects 4.5 Documentation > Getting Started With Direct to Java Client

   

(Optional) Specifying Additional Available Specifications

Recall that when an application starts up, it makes a rule system request with the request key availableSpecifications. The result is a list of all the rule system requests the client can make. The requests are expressed as EOSpecification objects, which identify a request key and state information. For more information on specifications, see the section Server Side XML Generation.

The default Direct to Java Client rules provide hooks for adding to an application's available specifications. The process is similar to that for adding to an application's available actions. You create a rule with the key additionalAvailableSpecifications. The value should be a D2WComponent that generates XML to describe an EOSpecification. When the availableSpecifications rule is fired, any rule with the request key additionalAvailableSpecifications is also fired, and the resulting EOSpecification is added to the set of default specifications.

  1. Write a custom rule that specifies the following:

    The value, AboutWebObjectsSpecifications is a D2WComponent that generates the XML for the custom action.

  2. Write the AboutWebObjectsSpecifications D2WComponent

    AboutWebObjectsSpecifications.html

    < <WEBOBJECT name=aboutWebObjectsSpecification/>

    AboutWebObjectsSpecifications.wod

    aboutWebObjectsSpecification: EOSwitchComponent {
      componentName = "EOSpecification";
      question = "window";
      task = "aboutWebObjects";

    }

This task is optional, but it usually improves performance. It delays the rule system request for the XML description of the window until the window is really needed (the "About WebObjects" command has been clicked). If you don't specify an additional available specification, the client application makes a rule-system request when the command for the action is created. It requests the XML simply to verify that the window is actually present. However, since all windows described in the available specifications are assumed to be accessible, the rule system request is delayed until the window is opened by the end user.


© 1999 Apple Computer, Inc. – (Draft. Last updated 05 Jan 00)